/**
 * Below is a sample adapter for connecting with a webservice.
 */


var myticketAdapter={
      
    fetch:function(item,callback){   
         
        $.get(BASE_URL+"mytickets_list?id="+localStorage.getItem("userID"),
            function(obj){                
                obj=JSON.parse(obj); 
                if(callback)  
                    callback(obj);
                
            }
        );
            
        
    },
    fetchAll:function(id,callback){
         
        $.get(BASE_URL+"mytickets_list?id="+localStorage.getItem("userID"),
            function(obj){
               
                obj=JSON.parse(obj);
                if(callback)
                    callback(obj);
            }
        );
    },
}
 

Myticket =  $.mvc.model.extend("myticket",{
    validate:function(opts){
        if(opts&&opts.trigger)
            return "error validating";
        return true;
    },
    voucherID: '',
    order_detailID: '',
    dealID: '',
    eventpackageID: '',
    voucher_code: '',
    eventID: '',
    eventpackageTitle: '',
    price: '',
    winsPrice: '',
    vipPrice: '',
    retailPrice: '',
    eventpackageQTY: '',
    eventpackagebalanceQTY: '',
    currencyID: '',
    code: '',
    eventTitle: '',
    location: '',
    userID: ''
}, myticketAdapter);

var myticket = new Myticket();
  
 